package lucene;

import java.io.File;
import java.io.IOException;

import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.index.CorruptIndexException;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.index.Term;
import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.CachingWrapperFilter;
import org.apache.lucene.search.Filter;
import org.apache.lucene.search.IndexSearcher;
//import org.apache.lucene.search.MultiSearcher;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.QueryWrapperFilter;
import org.apache.lucene.search.ScoreDoc;
//import org.apache.lucene.search.Searcher;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.search.TopDocsCollector;
import org.apache.lucene.search.TopScoreDocCollector;
import org.apache.lucene.search.TotalHitCountCollector;
import org.apache.lucene.search.spans.SpanNearQuery;
import org.apache.lucene.search.spans.SpanQuery;
import org.apache.lucene.search.spans.SpanTermQuery;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.FSDirectory;
//import org.apache.lucene.store.instantiated.InstantiatedIndex;
//import org.apache.lucene.store.instantiated.InstantiatedIndexReader;
import org.apache.lucene.util.Version;

 
 IndexSearcher indexSearcher;

	 String pathToIndex = //"D:\\indexes\\20newsgroups";
	                               //   "D:\\indexes\\medical50";
											//	"D:\\indexes\\indexes\\reuters10";
			//"C:\\indexes\\reuters10";
	//"C:\\Users\\laurie\\Java\\indexes\\ind1"; 
	"C:\\Users\\laurie\\Java\\indexes\\indexReuters10";
//	"C:\\indexes\\20newsgroups";
			
		//	C:\indexes\reuters10
//	"D:\\indexes\\indexes\\reuters90";

			
			//Directory dir = FSDirectory.open(new File(pathToIndex));
		//	Analyzer analyzer = new StandardAnalyzer(Version.LUCENE_45);
		    IndexReader reader = DirectoryReader.open(FSDirectory.open(new File(pathToIndex)));
		    System.out.println("numb docs " + reader.numDocs());
		    System.out.println("max docs " + reader.maxDoc());
	        
			println "hello"
			
		    indexSearcher = new IndexSearcher(reader);
		    
	   
	